import axios from '../index';

async function getTemplateList() {
    const response=await axios.get("legal/document/template/list");
    return response;
}

async function createTemplate(url,id){
    const response=await axios.post("legal/document/batchAdd",{
        "templateId":id,  //模板ID
        "excelFile":url,                            //上传到七牛的Excel文件URL
        "fileFormat": "xlsx"                        //xls或xlsx
    });

    return response;
}

async function getBatchList(id,batchNo){
    const response=await axios.post("legal/document/list",{
         "generation": batchNo                           //批次号，从批量创建接口返回中获取
    });
    return response;
}

async function getDownDocument(id){
    const response=await axios.post("legal/document/view", {s:id})
    return response;
   
}

async function getHistoryList(){
    const response=await axios.post("legal/document/generation/list");
    return response;
}

export {getTemplateList,createTemplate,getBatchList,getDownDocument,getHistoryList}